<div class="form-group clearfix">
  <div class="form-inline pull-left">
    <label >
      <span>商品筛选：</span>
    </label>
    <button nz-button [nzType]="'default'" (click)="showModal()">
      <span style="width: 100px;display: block;overflow: hidden;text-overflow: ellipsis;">{{checkName?checkName:'点击选择商品'}}</span>
    </button>
    <label style="margin-left:20px;">
      <span>活动区间：</span>
    </label>
    <nz-datepicker style="width: 200px;" (ngModelChange)="_startDate=$event;_startValueChange()" [ngModel]="_startDate" [nzDisabledDate]="_disabledStartDate" [nzShowTime]="true" [nzFormat]="'YYYY-MM-DD HH:mm'" [nzPlaceHolder]="'开始时间'"></nz-datepicker>
    <nz-datepicker style="width: 200px;" (ngModelChange)="_endDate=$event;_endValueChange()" [ngModel]="_endDate" [nzDisabledDate]="_disabledEndDate" [nzShowTime]="true" [nzFormat]="'YYYY-MM-DD HH:mm'" [nzPlaceHolder]="'结束时间'"></nz-datepicker>
  </div>
  <div class="form-inline pull-right">
    <button nz-button [nzType]="'primary'" (click)="search()">
      <span>搜索</span>
    </button>
    <button nz-button [nzType]="'default'" (click)="reset()">
      <span>重置</span>
    </button>
  </div>
</div>
<div class="clearfix">
  <div class="pull-left">数据列表</div>
  <div class="form-inline pull-right">
    <a class="ant-btn ant-btn-default" style="line-height: 26px;" [href]="getDownUrl()" target="_blank">导出数据</a>
    <nz-select style="width: 120px;" [(ngModel)]="orderBy" (ngModelChange)="changeOrder($event)" nzAllowClear>
      <nz-option nzLabel="排序方式" nzValue=""></nz-option>
      <nz-option nzLabel="总积分" nzValue="point_history"></nz-option>
      <nz-option nzLabel="销售额" nzValue="discount_price"></nz-option>
      <nz-option nzLabel="订单量" nzValue="completed_task_total"></nz-option>
    </nz-select>
  </div>
</div>
<div class="table-responsive">
  <nz-spin [nzTip]="'正在读取审核列表...'" [nzSpinning]="_isSpinning" [nzSize]="'large'" class="admin-spin">
    <table class="table">
      <thead>
      <tr>
        <th style="width:200px;">用户ID</th>
        <th style="width:200px;">手机号</th>
        <th style="width:200px;">推客姓名</th>
        <th style="width:200px;">注册时间</th>
        <th style="width:200px;">总积分</th>
        <th style="width:200px;">订单数量</th>
        <!-- <th style="width:200px;">销售额</th>-->
        <!-- <th style="width:400px;">账户启用状态</th> -->
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let item of withDrawList">
        <td>{{ item.id }}</td>
        <td>{{ item.mobile }}</td>
        <td>{{ item.realname}}</td>
        <td>{{ item.created_at_date }}</td>
        <td>{{ item.points}}</td>
        <td>{{ item.completed_task_total }}</td>
         <!-- <td>
          {{ item.discount_price }}
        </td>-->
        <!-- <td>
          {{ item.change_point }}
        </td> -->
      </tr>
      </tbody>
    </table>
  </nz-spin>
  <div class="text-center">
    <pagination (pageChanged)="pageChanged($event)" [totalItems]="total" [(ngModel)]="page"
                [itemsPerPage]="pageSize"
                [maxSize]="10"
                previousText="&lsaquo;" nextText="&rsaquo;" firstText="&laquo;" lastText="&raquo;"
                [boundaryLinks]="true" class="pagination-sm">
    </pagination>
  </div>
</div>
<!--<app-notification [type]="type" [message]="message" [isShow]="isShow"-->
                  <!--(promptIsShow)="isShow = $event;"></app-notification>-->

<nz-modal [nzVisible]="isVisible" [nzTitle]="'选择商品'" [nzContent]="modalContent" (nzOnCancel)="handleCancel($event)" (nzOnOk)="handleOk($event)">
  <ng-template #modalContent>
    <div style="height:400px;overflow:auto;">
      <div class="task-search">
        <label>任务名称</label>
        <nz-input [(ngModel)]="taskNameShow" style="width:120px;" [nzPlaceHolder]="'请输入任务名称'"></nz-input>
        <label>分类</label>
        <div style="display:inline-block">
          <nz-cascader nzPlaceHolder="请选择分类"
            style="width:180px;"
            [(ngModel)]="typeValue"
            (ngModelChange)="_console($event)"
            (nzChange)="_console($event)"
            (nzLoad)="loadData($event)">
          </nz-cascader>
        </div>
        <button nz-button [nzType]="'primary'" (click)="search1()">
          <span>搜索</span>
        </button>
      </div>
      <div class="task-list" style="margin-top:10px">
        <nz-table [nzTotal]="taskTotal" [nzPageSize]="taskPageSize" #nzTable [nzAjaxData]="taskList" [nzPageIndex]="taskPage" (nzPageIndexChangeClick)="changePage($event)" >
          <thead nz-thead>
            <tr>
              <th nz-th></th>
              <th nz-th style="width:80px"><span>id</span></th>
              <th nz-th><span>任务名称</span></th>
            </tr>
          </thead>
          <tbody nz-tbody>
            <tr nz-tbody-tr *ngFor="let data of taskList;let i = index" >
              <td nz-td [nzCheckbox]="true">
                <label nz-checkbox [ngModel]="data.id==checkId?true:false" (ngModelChange)="_refreshStatus($event,data)">
                </label>
              </td>
              <td nz-td>
                <a>{{data.id}}</a>
              </td>
              <td nz-td>{{data.task_name}}</td>
            </tr>
          </tbody>
        </nz-table>
      </div>
    </div>
  </ng-template>
</nz-modal>
